﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Eneta.Portal.Forum.Rss
{
    [Serializable]
    public class RssChannel : RssElement
    {
        // Fields
        private RssCategoryCollection categories = new RssCategoryCollection();
        private RssCloud cloud = null;
        private string copyright = "";
        private string description = "";
        private string docs = "";
        private string generator = "";
        private RssImage image = null;
        private RssItemCollection items = new RssItemCollection();
        private string language = "";
        private DateTime lastBuildDate = RssDefault.DateTime;
        private Uri link = RssDefault.Uri;
        private string managingEditor = "";
        private DateTime pubDate = RssDefault.DateTime;
        private string rating = "";
        private bool[] skipDays = new bool[7];
        private bool[] skipHours = new bool[0x18];
        private RssTextInput textInput = null;
        private int timeToLive = -1;
        private string title = "";
        private string webMaster = "";

        // Methods
        public override string ToString()
        {
            if (this.title != null)
            {
                return this.title;
            }
            if (this.description != null)
            {
                return this.description;
            }
            return "RssChannel";
        }

        // Properties
        public RssCategoryCollection Categories
        {
            get
            {
                return this.categories;
            }
        }

        public RssCloud Cloud
        {
            get
            {
                return this.cloud;
            }
            set
            {
                this.cloud = value;
            }
        }

        public string Copyright
        {
            get
            {
                return this.copyright;
            }
            set
            {
                this.copyright = RssDefault.Check(value);
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = RssDefault.Check(value);
            }
        }

        public string Docs
        {
            get
            {
                return this.docs;
            }
            set
            {
                this.docs = RssDefault.Check(value);
            }
        }

        public string Generator
        {
            get
            {
                return this.generator;
            }
            set
            {
                this.generator = RssDefault.Check(value);
            }
        }

        public RssImage Image
        {
            get
            {
                return this.image;
            }
            set
            {
                this.image = value;
            }
        }

        public RssItemCollection Items
        {
            get
            {
                return this.items;
            }
        }

        public string Language
        {
            get
            {
                return this.language;
            }
            set
            {
                this.language = RssDefault.Check(value);
            }
        }

        public DateTime LastBuildDate
        {
            get
            {
                return this.lastBuildDate;
            }
            set
            {
                this.lastBuildDate = value;
            }
        }

        public Uri Link
        {
            get
            {
                return this.link;
            }
            set
            {
                this.link = RssDefault.Check(value);
            }
        }

        public string ManagingEditor
        {
            get
            {
                return this.managingEditor;
            }
            set
            {
                this.managingEditor = RssDefault.Check(value);
            }
        }

        public DateTime PubDate
        {
            get
            {
                return this.pubDate;
            }
            set
            {
                this.pubDate = value;
            }
        }

        public string Rating
        {
            get
            {
                return this.rating;
            }
            set
            {
                this.rating = RssDefault.Check(value);
            }
        }

        public bool[] SkipDays
        {
            get
            {
                return this.skipDays;
            }
            set
            {
                this.skipDays = value;
            }
        }

        public bool[] SkipHours
        {
            get
            {
                return this.skipHours;
            }
            set
            {
                this.skipHours = value;
            }
        }

        public RssTextInput TextInput
        {
            get
            {
                return this.textInput;
            }
            set
            {
                this.textInput = value;
            }
        }

        public int TimeToLive
        {
            get
            {
                return this.timeToLive;
            }
            set
            {
                this.timeToLive = RssDefault.Check(value);
            }
        }

        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = RssDefault.Check(value);
            }
        }

        public string WebMaster
        {
            get
            {
                return this.webMaster;
            }
            set
            {
                this.webMaster = RssDefault.Check(value);
            }
        }
    }
}
